import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
	scrollBehavior(to, from, savedPosition) {
		if (savedPosition) {
			return savedPosition
		} else {
			if (from.meta.keepAlive) {
				from.meta.savedPosition = document.body.scrollTop;
			}
			return {
				x: 0,
				y: to.meta.savedPosition || 0
			}
		}
	},
  mode:'history',
	routes: [{
			path: '/',
			redirect: '/home'
		},
		{
			path: '/home',
			component: () => import('@/page/home/home'),
			meta: {
				title:'首页'
			}
		},
		{
			path: '/login',
			component: () => import('@/page/login/login'),
			meta:{
				title:'登录'
			}
		},
		{
			path: '/register',
			component: () => import('@/page/login/register'),
			meta:{
				title:'注册'
			}
		},
		{
			path: '/forgetPassword',
			component: () => import('@/page/login/forgetPassword'),
			meta:{
				title:'忘记密码'
			}
		},
		{
			path: '/mine',
			component: () => import('@/page/mine/mine'),
			meta:{
				title:'我的'
			}
		},
		{
			path: '/applyPay',
			component: () => import('@/page/other/applyPay'),
			meta:{
				title:'申请付款'
			}
		},
		{
			path: '/mineInformation',
			component: () => import('@/page/mine/mineInformation'),
		},
		{
			path: '/orderList',
			component: () => import('@/page/order/orderList'),
			meta: {
				keepAlive: true,
				title:'订单列表'
			}
		},
		{
			path:'/orderInformation',
			component:() => import('@/page/order/orderInformation'),
			meta:{
				title:'订单详情'
			}
		},
		{
			path:'/quotation',
			component: () => import('@/page/upload/quotation'),
			meta:{
				title:'报价单'
			}
		},
		{
			path:'/signingContract',
			component: () => import('@/page/upload/signingContract'),
			meta:{
				title:'签章合同'
			}
		},
		{
			path:'/orderPoundlist',
			component: () => import('@/page/order/orderPoundlist'),
			meta:{
				title:'出库磅单'
			}
		},
		{
			path:'/ponderationList',
			component: () => import('@/page/ponder/ponderationList'),
			meta:{
				title:'收货磅单'
			}
		},
		{
			path:'/ponderationInformation',
			component: () => import('@/page/ponder/ponderationInformation'),
			meta:{
				title:'过磅单详情'
			}
		},
		{
			path:'/mutongponderInformation',
			component: () => import('@/page/ponder/mutongponderInformation'),
			meta:{
				title:'沐桐过磅单详情'
			}
		},
    {
    	path:'/autograph',
    	component: () => import('@/page/other/autograph'),
    	meta:{
    		title:'签名'
    	}
    },
		{
			path:'/LookPonderation',
			component: () => import('@/page/ponder/LookPonderation'),
			meta:{
				title:'查看过磅单图片'
			}
		},
		{
			path:'/transportCompletion',
			component: () => import('@/page/transport/transportCompletion'),
			meta:{
				title:'确认运输完毕'
			}
		},
		{
			path:'/bankTicket',
			component: () => import('@/page/other/bankTicket'),
			meta:{
				title:'银行回单'
			}
		},
		{
			path:'/confirmwarehouseReceipt',
			component: () => import('@/page/other/confirmwarehouseReceipt'),
			meta:{
				title:'查看收货单'
			}
		},
		{
			path:'/orderTransport',
			component: () => import('@/page/order/orderTransport'),
			meta:{
				title:'运输车订单'   //订单里面点进去，只可查看
			}
		},
		{
			path:'/LooktransportInformation',
			component: () => import('@/page/transport/LooktransportInformation'),
			meta:{
				title:'运输车订单'
			}
		},
		{
			path:'/transportList',
			component: () => import('@/page/transport/transportList'),
			meta:{
				title:'运输车订单'
			}
		},
		{
			path:'/addTransport',
			component: () => import('@/page/transport/addTransport'),
			meta:{
				title:'添加运输车'
			}
		},
		{
			path:'/addTransportMaterial',
			component: () => import('@/page/material/addTransportMaterial'),
			meta:{
				title:'添加运输车物料'
			}
		},
		{
			path:'/materialList',
			component: () => import('@/page/material/materialList'),
			meta:{
				title:'物料列表'
			}
		},
		{
			path:'/addMaterial',
			component: () => import('@/page/material/addMaterial'),
			meta:{
				title:'添加物料'
			}
		},
		{
			path:'/deleteMaterial',
			component: () => import('@/page/material/deleteMaterial'),
			meta:{
				title:'删除物料'
			}
		},
		{
			path:'/waitsubmitOrder',
			component: () => import('@/page/order/waitsubmitOrder'),
			meta:{
				title:'待提交'
			}
		},
		{
			path:'/qualityInformation',
			component: () => import('@/page/other/qualityInformation'),
			meta:{
				title:'查看质检单信息'
			}
		}
	]
})
